package com.yoipdu.im1.service.impl;

import com.yoipdu.im1.service.UserService;
import com.yoipdu.im1.util.JsonData;
import com.yoipdu.im1.util.Tools;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    private Tools tools = new Tools();
    private JsonData json;

    @Override
    public Map<String, Object> login() {
        json = new JsonData();
        String id = tools.generateVerCode();
        id = tools.md5(id);
        id = id.substring(0, 4);
        json.put("id", id);
        return json.to();
    }
}
